Conversation
Signed-off-by: Revital Sur <eres@il.ibm.com>
…tekeeper' workflow. Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
There was a problem hiding this comment.
typo in file name, missing n
| @@ -0,0 +1,18 @@ | |||
| name: ChatOps Dispatcher | |||
There was a problem hiding this comment.
due to my lack of knowledge, what does this action do? Is only used to dispatch other jobs when a comment is made?
There was a problem hiding this comment.
Yes It is a "traffic controller" action that robustly parses slash commands (like /lgtm) from comments, validates user permissions, and dispatches events to trigger specific workflows.
| @@ -0,0 +1,18 @@ | |||
| name: ChatOps Dispatcher | |||
| on: | |||
| issue_comment: | |||
There was a problem hiding this comment.
Q: shuoldn't this be done on PR comments? (assuming there is such a trigger)
There was a problem hiding this comment.
No, apparently in GitHub's internal architecture, every Pull Request is an Issue. It has issue-type: pull-request defined later in the yml...
| # | ||
| # Flow: | ||
| # 1. User comments /lgtm on PR | ||
| # 2. chatops-dispatcher catches it and dispatches here |
There was a problem hiding this comment.
how does the dispatcher know which job/action to invoke?
I did not see a reference to lgtm-command in that file.
There was a problem hiding this comment.
It is an "invisible handshake" done through Events, not file references. When /lgtm is typed, the slash-command-dispatch action fires a Repository Dispatch event. By default, it constructs the event type by adding -command to the slash command.
The Signal: When the dispatcher validates the /lgtm comment, it broadcasts a repository_dispatch event with the custom type lgtm-command.
The Listener: The lgtm-command.yml workflow is explicitly configured to listen for this signal via types: [lgtm-command].
There was a problem hiding this comment.
not a fan of calling it "chatops" in file or action name. Please use a more specific name (e.g. dispatch-on-lgtm)
.github/workflows/lgtm-commad.yml
Outdated
| - name: Apply Label & Merge | ||
| if: steps.check.outputs.authorized == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.BOT_TOKEN }} |
There was a problem hiding this comment.
Q: how do we issue and maintain a bot token? who owns it (e.g., user associated, expiration time, ...)
There was a problem hiding this comment.
I need to investigate how to properly configure a Personal Access Token (PAT) for this repository.
There was a problem hiding this comment.
I've updated the workflows to use a GitHub App via tibdex/github-app-token@v1, which generates short-lived access tokens automatically. This eliminates the need for a dedicated, long-lived Personal Access Token (PAT) and ensures that bot-triggered events successfully spawn subsequent workflow runs.
.github/workflows/lgtm-commad.yml
Outdated
| exit 1 | ||
| fi | ||
|
|
||
| echo "Waiting 5 minutes before setting auto-merge..." |
There was a problem hiding this comment.
is the sleep required?
having a job wait for 5m slows down the loop. Is there a way to structure the events so the wait is not needed?
There was a problem hiding this comment.
No, its not needed and can be removed. I wanted to give the pr writer or other approver an opportunity to take a final look at the checks or the code before the merge sequence officially started when the testing is finishes quickly. I will remove it.
| @@ -0,0 +1,42 @@ | |||
| # ============================================================================ | |||
| # LGTM Gatekeeper - Required Status Check | |||
There was a problem hiding this comment.
Q: there seems to be quite a bit of overlap between this file and the previous. Can you explain how they differ and what purpuse they serve.
| exit 1 | ||
| fi | ||
|
|
||
| echo "✅ PASSED: LGTM present and no blockers." No newline at end of file |
There was a problem hiding this comment.
nit: missing newline at end of file
.github/workflows/lgtm-reset.yml
Outdated
| gh pr merge --disable-auto $PR_NUMBER --repo "$REPO" || true | ||
|
|
||
| # 3. Notify user | ||
| gh issue comment $PR_NUMBER --repo "$REPO" --body "🔄 **Reset**: New commits pushed. LGTM removed." No newline at end of file |
There was a problem hiding this comment.
nit: newline at end of file
|
It is complementary. |
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
DEVELOPMENT.md
Outdated
|
|
||
| ## PR Approval Process | ||
|
|
||
| The project uses a Prow-inspired ChatOps system to manage PR approvals via comment commands. |
There was a problem hiding this comment.
ChatOps was removed from PR ?
There was a problem hiding this comment.
ChatOps hasn't been removed, but the /lgtm command was separated from the standard Prow bot into a dedicated, custom workflow.
| - ✅ **Both `lgtm` and `approve` labels** - Required for merge approval | ||
| - ✅ **No blocking labels** - The `hold` label must not be present | ||
| - ✅ **All required status checks passing** - CI/CD checks must succeed | ||
|
|
There was a problem hiding this comment.
Please Signed verified commits
There was a problem hiding this comment.
Updated Developer.md: Added documentation noting that signed commits can be enforced as a pre-merge check via branch rulesets
Signed-off-by: Revital Sur <eres@il.ibm.com>
Signed-off-by: Revital Sur <eres@il.ibm.com>
|
Thanks for the feedback on this! I'm going to close this out for now so I can do some more thorough testing on my end before moving forward. |

This pr replaces the Prow-based /lgtm implementation (#580).
The solution decouples the logic into the following workflows:
below is a diagram of the execution flow.
Note:
Tested on my local fork.